<template>
<div>
    <div>
        <van-nav-bar :fixe="true" :placeholder="true" title="授权考勤员" left-text="返回" left-arrow @click-left="onClickLeft" />
    </div>
    <div>
        <van-row style="text-align: center;margin-top: 100px;">
            <van-button type="info" size="large" @click="authorization()">授权考勤员</van-button>
        </van-row>
    </div>

    <van-tabbar v-model="active">
        <van-tabbar-item icon="home-o" to="/index">首页</van-tabbar-item>
        <van-tabbar-item icon="search">办理</van-tabbar-item>
        <van-tabbar-item icon="friends-o">新建</van-tabbar-item>
        <van-tabbar-item icon="setting-o">统计</van-tabbar-item>
        <van-tabbar-item icon="manager-o" to="/wode">我的</van-tabbar-item>

    </van-tabbar>
</div>
</template>

<script>
import Vue from "vue";
import Cookies from "js-cookie";
import {
    Lazyload
} from "vant";
import {
    Dialog
} from "vant";
Vue.use(Lazyload);
export default {
    data() {
        return {

        };
    },
    created() {

    },
    methods: {

        onClickLeft() {
            this.$router.go(-1);
        },authorization(){
             this.$axios({
                headers: {
                    'Content-Type': 'application/x-www-form-urlencoded'
                },
                method: 'post',
                url: 'auditAuthorize/authorize',
            }).then((response) => { //这里使用了ES6的语法
                    if (response.data.code == '200') {
                            Dialog.alert({
                                title: "成功",
                                message: response.data.msg
                            }).then(() => {
                                this.$router.go(-1); //返回上一层
                            });
                        } else {
                            Dialog.alert({
                                title: "错误",
                                message: response.data.msg
                            }).then(() => {
                                this.$router.go(-1); //返回上一层
                            });
                        }
            })
        }
        
    }
};
</script>

<style>

</style>
